export default app => {
  const { STRING, INTEGER, DATE } = app.Sequelize;

  const talentClassfication = app.model.define('talent_classfication', {
    id: { type: INTEGER, primaryKey: true, autoIncrement: true },
    uuid: { type: STRING(36), unique: true },
    typeName: STRING(10), // 分类名称
    typeDescription: STRING(255), // 备注说明
    createdAt: DATE,
    updatedAt: DATE,
  });
  talentClassfication.associate = () => {
    app.model.TalentClassfication.hasMany(app.model.Talent, {
      foreignKey: 'pk_type',
      sourceKey: 'uuid',
    });
  };
  return talentClassfication;
};
